package cn.classg.rabbitmq.annotation;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.core.annotation.AliasFor;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 消息交换机
 * @author CLASSG
 */
@Target({})
@Retention(RetentionPolicy.RUNTIME)
public @interface MqExchange {

    String TRUE = "true";

    String FALSE = "false";

    /**
     * @return the exchange name.
     */
    @AliasFor("name") String value() default "";

    /**
     * @return the exchange name.
     * @since 2.0
     */
    @AliasFor("value") String name() default "";

    /**
     * The exchange type, including custom.
     * Defaults to {@link ExchangeTypes#DIRECT}.
     * If a custom exchange type is used the corresponding plugin is required on the broker.
     *
     * @return the exchange type.
     * @see ExchangeTypes
     */
    String type() default ExchangeTypes.DIRECT;

    /**
     * @return false if the exchange is to be declared as non-durable.
     */
    String durable() default TRUE;

    /**
     * @return true if the exchange is to be declared as auto-delete.
     */
    String autoDelete() default FALSE;

    /**
     * exchange priority level
     * @return
     */
    int order() default Integer.MIN_VALUE;
}
